<div id="carousel_categories" class="carousel slide categories-carousel">
    <!-- Carousel items -->
    <div class="carousel-inner">
        <% categories.each_slice(6).each_with_index do |_cats, index| %>
            <div class='item <%= "active" if index == 0 %>'>
                <div class='row'>
                    <% _cats.each do |cat| %>
                        <div class="col-md-2">
                            <a href="<%= cat.the_url %>" class="thumbnail text-center">
                                <img src="<%= cat.the_thumb_url %>" alt="Image" style="max-width:100%;">
                                <span class="category-title"><%= cat.the_title %></span>
                            </a>
                        </div>
                    <% end %>
                </div>
            </div>
        <% end %>
    </div><!--.carousel-inner-->
    <% if categories.size > 6 %>
        <a data-slide="prev" href="#carousel_categories" class="left carousel-control">‹</a>
        <a data-slide="next" href="#carousel_categories" class="right carousel-control">›</a>
    <% end %>
</div><!--.Carousel-->